#include<iostream>
#include<string>

using namespace std;

int main(void) {  
	
	char c;
	cin >> c;
	if(c >= 'A' && c <= 'Z') {
		int n = (int)(c - 'A');
		for(int i = 0; i <= n; i++) {
			string space = string( n - i , ' ');
			cout << space; 
			char temp = 'A';
			int j;
			for(j = 0; j <= i; j++) {
				cout << temp;
				temp++;
			}
			temp--;
			temp--; 
			while(temp >= 'A') {
				cout << temp;
				temp--;
			}
			cout << endl; 
		}	 
	} else if (c >= 1 && c <= 9) {
		int n = (int)c;
		for(int i = 0; i <= n; i++) {
			string space = string( n - i , ' ');
			cout << space; 
			int num = 1;
			int j;
			for(j = 0; j <= i; j++) {
				cout << num;
				num++;
			}
			num--;
			num--; 
			while(num >= 1) {
				cout << num;
				num--;
			}
			cout << endl; 
		} 
	}
	
	return 0;
}

